#include "stdafx.h"
#include "DeleteAction.h"
#include "defines.h"
#include "DataFlow.h"

DeleteAction::DeleteAction(int tempId, int tempOrder)
{
	_m.id = tempId;
	_m.unit_type = tempOrder;
}

void DeleteAction::redo()
{
	findUnit(_m.id)->DistachTracker();
	theApp.m_UnitManager->Delete(findUnit(_m.id));
}

void DeleteAction::undo()
{
	if( _m.unit_type == ARROW_UNIT || _m.unit_type == ARROW2_UNIT)
		theApp.m_UnitManager->AddArrow(findUnit(_m.id));
	else
		theApp.m_UnitManager->AddShape(findUnit(_m.id));
}

